package cn.jdbc;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import cn.util.Jdbcutil;

public class Demo01 {
	public static void main(String[] args) {
		Connection connection = null;
		PreparedStatement preparedStatement = null;
		try {
			connection = Jdbcutil.getConnection();
			String sql = "insert into Student(name,age,gender) values('wang',1,'男')";
			preparedStatement = connection.prepareStatement(sql);
			int count = preparedStatement.executeUpdate();
			System.out.println(count);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}finally {
			Jdbcutil.close(connection, null, null, preparedStatement);
		}
	}

}
